<input name="page" type="hidden" value=""/>
<!--分页按钮-->
#if($!form.totalRecords>0)
<div class="page" >
  #if($!form.page==1)
    <a class="prev unclick" href="javascript:void(0);">上一页</a>
  #else
    <a class="prev" href="javascript:topage($!form.page -1)">上一页</a>
  #end
  #if($!form.totalPages > 0)
    #foreach($index in [$form.pageIndex.startIndex..$form.pageIndex.endIndex])
      #if($index == $form.page)
      <a class="on" href="javascript:void(0);">$index</a>
      #else
      <a href="javascript:topage('$index')">$index</a>
      #end
    #end
  #end
  #if($!form.page==$!form.totalPages)
    <a class="next unclick" href="javascript:void(0);">下一页</a>
  #else
    <a class="next" href="javascript:topage($!form.page+1)">下一页</a>
  #end
</div>
#end
<!--end分页按钮-->
<script type="text/javascript">
function topage(page){
  var form = document.forms[0];
  form.page.value=page;
  try{
    //触发绑定事件提交查询前可做一些处理
    $(form).submit();
  }catch(e){
    //页面没有引用jquery
    form.submit();
  }
}   

function addUrlPara(name, value) {  
  var currentUrl = window.location.href.split('#')[0];  
  if (/\?/g.test(currentUrl)) {  
      if (/name=[-\w]{4,25}/g.test(currentUrl)) {  
          currentUrl = currentUrl.replace(/name=[-\w]{4,25}/g, name + "=" + value);  
      } else {  
          currentUrl += "&" + name + "=" + value;  
      }  
  } else {  
      currentUrl += "?" + name + "=" + value;  
  }  
  if (window.location.href.split('#')[1]) {  
      window.location.href = currentUrl + '#' + window.location.href.split('#')[1];  
  } else {  
      window.location.href = currentUrl;  
  }  
}
</script>